// $codepro.audit.disable variableUsage, unnecessaryOverride
/**
 * Doctor.java
 * @author Peter
 */
package edu.gatech.coc.betameisters.people;

import edu.gatech.coc.betameisters.infoholders.Constants.UserType;
import edu.gatech.coc.betameisters.infoholders.DoctorsOrders;
import edu.gatech.coc.betameisters.infoholders.Prescription;

/**
 * The Doctor class; like a nurse but can do more stuff
 * 
 * @author Peter
 * 
 * @version $Revision: 1.0 $
 */
public class Doctor extends Nurse {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4155552781642264806L;

	/**
	 * Constructor that creates a doctor
	 * 
	 * @param fName
	 *            - doctor's first name
	 * @param lName
	 *            - doctor's last name
	 */
	public Doctor(String fName, String lName) {
		super(fName, lName);
		personType = UserType.DOCTOR;
		MYLOGGER.info("In Doctor constructor");
	}
	
	/**
	 * Constructor  for a new doctor to be put on the database
	 * @param username Username
	 * @param password password
	 * @param fName first name
	 * @param lName last name
	 * @param pat This doctor's current patient
	 */
	public Doctor(String username, String password, String fName, String lName,
			Patient pat) {
		super(username, password, fName, lName, pat);
		personType = UserType.DOCTOR;
		MYLOGGER.info("In Doctor constructor");
	}

	/**
	 * Constructor that creates a doctor for (database use)
	 */
	public Doctor() {
		super(); // $codepro.audit.disable invocationOfDefaultConstructor
		personType = UserType.DOCTOR;
		MYLOGGER.info("In Doctor constructor");
	}

	/**
	 * Ideally a UI button, pulls up a section where lab report results are
	 * shown/displayed
	 */
	public void viewLabReport() {
		MYLOGGER.info("Doctor trying to view lab report");
		// pulls up lab report onto UI
	}

	/**
	 * Ideally a UI button, pulls up a section where the doctor can prescribe
	 * the patient medicine
	 */
	@SuppressWarnings("unused")
	public void signRX() {
		MYLOGGER.info("Doctor is trying to sign RX");
		final Prescription aPrescription = new Prescription(this, currentPatient);
		// pulls up prescription page on UI
	}

	/**
	 * Ideally a UI button, pulls up a section where the doctor can modify
	 * treatment details for the patient
	 */
	public void modifyTreatment() {
		MYLOGGER.info("Doctor is trying to modify treatment details");
	}

	/**
	 * Ideally a UI button, pulls up a section where the doctor can create
	 * orders for the patient
	 * 
	 * @param anOrder
	 *            - Doctor's custom order
	 * @return the doctor's order
	 */
	public DoctorsOrders createOrder(String anOrder) {
		MYLOGGER.info("Doctor is trying to modify order details");
		final DoctorsOrders someOrder = new DoctorsOrders(this.getLastName(),
				currentPatient.getLastName(), anOrder);
		return someOrder;
	}

	/**
	 * Set or change the patient's doctor's order
	 * 
	 * @param someOrder
	 */
	public void setPatientOrder(DoctorsOrders someOrder) {
		currentPatient.setMyDocOrders(someOrder, getUserID());
	}

	/**
	 * Deletes the patient's doctor's order
	 */
	public void deletePatientOrder() {
		currentPatient.setMyDocOrders(new DoctorsOrders("", "", ""), getUserID());
	}

	/**
	 * Gets the current patient's orders
	 * 
	 * @return doctor orders stored in patient
	 */
	public DoctorsOrders getPatientOrder() {
		return currentPatient.getMyDocOrders();
	}

	/**
	 * Overrides the default toString method
	 * 
	 * @return Doctor's name
	 */
	public String toString() {
		return "Doctor: " + this.getFirstName() + " " + this.getLastName();
	}

	/**
	 * <!-- // $codepro.audit.disable unnecessaryOverride --> Store a doctor
	 * into the database
	 */
	public void create() {
		super.create();
	}
}
